<?php
	class Template extends CI_Model{
		
		public function __construct(){
			parent::__construct();
		}
		
		public function header(){
			$str ='
			  	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
				<html xmlns="http://www.w3.org/1999/xhtml">
				<head>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
				<link rel="stylesheet" type="text/css" href="'.base_url().'css/theme.css" media="screen" />
				<link rel="stylesheet" type="text/css" href="'.base_url().'css/login.css" media="screen" />
				<title>Administrator</title>
				</head>
				
				<body>
				<div id="container"> 
				  <div class="radius-bottom" id="adminbar">
				    <div id="logo">Administrator</div>
				    <div id="detail-user">
				      <p>Hi! '.$this->session->userdata('sess_hname').'</p>
				      <a href="#" class="color-green">Visit website</a> | 
				      <a href="#" class="color-orang">Change Password</a> | 
				      <a href="'.base_url().'apanel/logout" class="color-red">Logout</a>
				      </p>
				    </div>
				    <div style="clear:both"></div>
				  </div>
			';
			return $str;
		}
		
		public function footer(){
			$str ='
				  <div id="footer"class="radius-bottom"> 2012 © eShineTV </div>
				  </div>
				</body>
				</html>
			';
			return $str;
		}
		
		public function menu($mark="",$active=""){
			$m1="";$m2="";$m3="";$m4="";$m5="";$m6="";$m7="";$m8="";
			$s1="";$s2="";$s3="";$s4="";$s5="";$s6="";$s7="";$s8="";
			switch ($mark){
				case 1: $m1='class="active submenu-active" '; $s1='<span class="submenu-arrow"></span>'; break;
				case 2: $m2='class="active submenu-active"'; $s2='<span class="submenu-arrow"></span>'; break;
				case 3: $m3='class="active submenu-active"'; $s3='<span class="submenu-arrow"></span>'; break;
				case 4: $m4='class="active submenu-active"'; $s4='<span class="submenu-arrow"></span>'; break;
				case 5: $m5='class="active submenu-active"'; $s5='<span class="submenu-arrow"></span>'; break;
				case 6: $m6='class="active submenu-active"'; $s6='<span class="submenu-arrow"></span>'; break;
				case 7: $m7='class="active submenu-active"'; $s7='<span class="submenu-arrow"></span>'; break;
				case 8: $m8='class="active submenu-active"'; $s8='<span class="submenu-arrow"></span>'; break;
			}
		 $strm ='<div id="menu" class="radius-top clearfix">
					    <ul id="main-menu" >
					      <li><a href="'.base_url().'apanel/dashboard" '.$m1.'><img src="'.base_url().'images/dashboard-icon.png"/>
					      <span>Dashboard</span></a></li>
					      <li><a href="'.base_url().'manage_hotel" '.$m2.'><img src="'.base_url().'images/hotel-icon.png" width="60" height="62" />
					      <span>Hotel Info</span>'.$s2.'</a></li>
					      <li><a href="'.base_url().'manage_channel" '.$m3.'><img src="'.base_url().'images/tvchanel-icon.png" width="70" height="52" />
					      <span>TV Channels</span>'.$s3.'</a></li>
					      <li><a href="'.base_url().'manage_movie" '.$m4.'><img src="'.base_url().'images/movies-icon.png" width="83" height="63" />
					      <span>Movies</span>'.$s4.'</a></li>
					      <li><a href="'.base_url().'manage_attrac" '.$m5.'><img src="'.base_url().'images/local-attraction-icon.png" width="66" height="67" />
					      <span>Local Attractions</span>'.$s5.'</a></li>
					      <li><a href="'.base_url().'manage_shopping" '.$m6.'><img src="'.base_url().'images/inroom-shopping-icon.png" width="75" height="63" />
					      <span>In Room Shopping</span>'.$s6.'</a></li>
					      <li><a href="'.base_url().'android.php" '.$m7.'><img src="'.base_url().'images/android-icon.png" width="56" height="66" />
					      <span>Android</span>'.$s7.'</a></li>
					      <li><a href="'.base_url().'site.php" '.$m8.'><img src="'.base_url().'images/setting-icon.png" width="56" height="66" />
					      <span>Site</span>'.$s8.'</a></li>
					    </ul>
					    '.$this->submenu($mark,$active).'
  					</div>';
			return $strm;
		}
		
		public function submenu($sub="",$active=""){
			$str = "";$a1="";$a2="";$a3="";$a4="";
			if($active =="" || $active == 1) $a1= 'class="active"';
			else if($active == 2) $a2= 'class="active"';
			else if($active == 3) $a3 = 'class="active"';
			switch ($sub){
				case 2: $str='
					 <ul id="sub-menu" class="clearfix">
				      <li><a href="'.base_url().'manage_hotel/attraction_cat" '.$a1.'>Attraction Category</a></li>
				      <li><a href="'.base_url().'manage_hotel/attraction_list" '.$a2.'>Attraction List</a></li>
				      <li><a href="'.base_url().'manage_hotel/meal_cat" '.$a3.'>Meal Category</a></li>
				      <li><a href="'.base_url().'manage_hotel/meal_list" '.$a4.'>Meal List</a></li>
				    </ul>
				';
				break;
				case 3: $str='
					 <ul id="sub-menu" class="clearfix">
      					<li><a href="tvChannels.php" '.$a1.'>Manage TV Channels</a></li>
    				</ul>
				';
				break;
				case 4: $str='
					<ul id="sub-menu" class="clearfix">
      					<li><a href="movies.php" '.$a1.'>Manage Movies</a></li>
    				</ul>
				';
				break;
				case 5: $str='
				<ul id="sub-menu" class="clearfix">
      				<li><a href="localAttractions.php" '.$a1.'>Manage Local Attraction</a></li>
    			</ul>
				';
				break;
				case 6: $str='
				<ul id="sub-menu" class="clearfix">
				      <li><a href="'.base_url().'manage_shopping/cate_list" '.$a1.'>Manage Category</a></li>
				      <li><a href="'.base_url().'manage_shopping/product_list" '.$a2.'>Manage Products</a></li>
    			</ul>
				';
				break;
				default:
			}
			return $str;
		}
	}
?>